package com.ruan.lkx.service;

import com.alibaba.fastjson.JSONObject;
import com.ruan.lkx.Constants;
import com.ruan.lkx.net.HttpUtils;

import java.util.List;

/**
 * @author Hy
 * @ClassName com.ruan.lkx.service.AnimalService
 * @create 2021年12月27日 17:29
 * @desc:
 */
public class AnimalService {
   public List<Animal> getAnimal(String s){

       String url= Constants.ANIMAL_URL+"?key="+Constants.ANIMAL_KEY+"&keyword="+s;
       String result = HttpUtils.get(url);
       System.out.println(result);
       AnimalCommon animalCommon = JSONObject.parseObject(result, AnimalCommon.class);
       return animalCommon.result;
   }


}
